#include "Base\stdafx.h"

#include "ShaderTestScene.h"

#include "Scenegraph/GameObject.h"

#include "Components/ModelComponent.h"
#include "Components/Components.h"
#include "Components/ParticleEmitterComponent.h"

#include "Content/ContentManager.h"
#include "Physx/PhysxManager.h"
#include "Components/TransformComponent.h"
#include "Physx\PhysxProxy.h"


#include "Graphics\ModelAnimator.h"
#include "Graphics\TextureData.h"
#include "..\..\Materials\FurShader.h"


ShaderTestScene::ShaderTestScene(void) :
	GameScene(L"ShaderTestScene")
{
}


ShaderTestScene::~ShaderTestScene(void)
{
}

void ShaderTestScene::Initialize(const GameContext& gameContext)
{
	UNREFERENCED_PARAMETER(gameContext);

	GetPhysxProxy()->EnablePhysxDebugRendering(false);
	
	auto physX = PhysxManager::GetInstance()->GetPhysics();

	//*****************
	//SHADER PRESENTATION
	//******************
	GameObject* furKnight = new GameObject();

	//level Material
	FurShader* furMat = new FurShader();
	furMat->SetDiffuseTexture(L"./Resources/Textures/Knight.jpg");
	furMat->SetDotTexture(L"./Resources/Textures/Dots.png");
	furMat->SetmaskTexture(L"./Resources/Textures/KnightMask.png");
	furMat->SetGravity(-0.1f);
	furMat->SetLength(1);
	furMat->SetUVSize(80);
	gameContext.pMaterialManager->AddMaterial(furMat, 7);

	//Level Model Component
	auto model = new ModelComponent(L"./Resources/Meshes/Knight.ovm");
	model->SetMaterial(7);
	furKnight->AddComponent(model);
	AddChild(furKnight);
	furKnight->GetTransform()->Translate(0,0,0);
	furKnight->GetTransform()->Scale(.1f, .1f, .1f);

	GameObject* ball = new GameObject();

	//level Material
	FurShader* furMat2 = new FurShader();
	furMat2->SetDiffuseTexture(L"./Resources/Textures/Leopard.png");
	furMat2->SetDotTexture(L"./Resources/Textures/Dots.png");
	furMat2->SetmaskTexture(L"./Resources/Textures/mask.png");
	furMat2->SetGravity(-1);
	furMat2->SetLength(0.5f);
	furMat2->SetUVSize(30);
	gameContext.pMaterialManager->AddMaterial(furMat2, 8);

	//Level Model Component
	auto modelball = new ModelComponent(L"./Resources/Meshes/Bullet.ovm");
	modelball->SetMaterial(8);
	ball->AddComponent(modelball);
	AddChild(ball);
	ball->GetTransform()->Translate(30,0,0);
	//ball->GetTransform()->Scale(.1f, .1f, .1f);
}

void ShaderTestScene::Update(const GameContext& gameContext)
{
	UNREFERENCED_PARAMETER(gameContext);
	
}

void ShaderTestScene::Draw(const GameContext& gameContext)
{
	UNREFERENCED_PARAMETER(gameContext);

}

